#!/bin/bash
set -e

echo $PATH

mongo --port 27017 << EOF

use admin

db.createUser({ 
user:"root", 
pwd:"123456", 
roles:[{role:"root",db:"admin"}]
})

use lagou_resume

db.createUser({
    user:"zhangsan",
    pwd:"123456",
    roles:[{role:"readWrite",db:"lg_resume"}]
})

db.createUser({
 user:"lagou_gx",
 pwd:"abc321",
 roles:[{role:"readWrite",db:"lg_resume"}]
 })
EOF